namespace CaltechSoft.Service.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class BaseEntity : DbMigration
    {
        public override void Up()
        {
            AlterColumn("dbo.Certificate", "CreatedBy", c => c.String(maxLength: 128));
            AlterColumn("dbo.CertificateStandard", "CreatedBy", c => c.String(maxLength: 128));
            AlterColumn("dbo.CustomerEquipments", "CreatedBy", c => c.String(maxLength: 128));
            AlterColumn("dbo.Customers", "CreatedBy", c => c.String(maxLength: 128));
            AlterColumn("dbo.Equipment", "CreatedBy", c => c.String(maxLength: 128));
            AlterColumn("dbo.QuoteItems", "CreatedBy", c => c.String(maxLength: 128));
            AlterColumn("dbo.Quotes", "CreatedBy", c => c.String(maxLength: 128));
            AlterColumn("dbo.WorkOrderDetails", "CreatedBy", c => c.String(maxLength: 128));
            AlterColumn("dbo.WorkOrders", "CreatedBy", c => c.String(maxLength: 128));
            CreateIndex("dbo.Certificate", "CreatedBy");
            CreateIndex("dbo.CertificateStandard", "CreatedBy");
            CreateIndex("dbo.CustomerEquipments", "CreatedBy");
            CreateIndex("dbo.Customers", "CreatedBy");
            CreateIndex("dbo.Equipment", "CreatedBy");
            CreateIndex("dbo.QuoteItems", "CreatedBy");
            CreateIndex("dbo.Quotes", "CreatedBy");
            CreateIndex("dbo.WorkOrderDetails", "CreatedBy");
            CreateIndex("dbo.WorkOrders", "CreatedBy");
            AddForeignKey("dbo.Certificate", "CreatedBy", "dbo.AspNetUsers", "Id");
            AddForeignKey("dbo.CertificateStandard", "CreatedBy", "dbo.AspNetUsers", "Id");
            AddForeignKey("dbo.Equipment", "CreatedBy", "dbo.AspNetUsers", "Id");
            AddForeignKey("dbo.Customers", "CreatedBy", "dbo.AspNetUsers", "Id");
            AddForeignKey("dbo.CustomerEquipments", "CreatedBy", "dbo.AspNetUsers", "Id");
            AddForeignKey("dbo.Quotes", "CreatedBy", "dbo.AspNetUsers", "Id");
            AddForeignKey("dbo.QuoteItems", "CreatedBy", "dbo.AspNetUsers", "Id");
            AddForeignKey("dbo.WorkOrderDetails", "CreatedBy", "dbo.AspNetUsers", "Id");
            AddForeignKey("dbo.WorkOrders", "CreatedBy", "dbo.AspNetUsers", "Id");
        }
        
        public override void Down()
        {
            DropForeignKey("dbo.WorkOrders", "CreatedBy", "dbo.AspNetUsers");
            DropForeignKey("dbo.WorkOrderDetails", "CreatedBy", "dbo.AspNetUsers");
            DropForeignKey("dbo.QuoteItems", "CreatedBy", "dbo.AspNetUsers");
            DropForeignKey("dbo.Quotes", "CreatedBy", "dbo.AspNetUsers");
            DropForeignKey("dbo.CustomerEquipments", "CreatedBy", "dbo.AspNetUsers");
            DropForeignKey("dbo.Customers", "CreatedBy", "dbo.AspNetUsers");
            DropForeignKey("dbo.Equipment", "CreatedBy", "dbo.AspNetUsers");
            DropForeignKey("dbo.CertificateStandard", "CreatedBy", "dbo.AspNetUsers");
            DropForeignKey("dbo.Certificate", "CreatedBy", "dbo.AspNetUsers");
            DropIndex("dbo.WorkOrders", new[] { "CreatedBy" });
            DropIndex("dbo.WorkOrderDetails", new[] { "CreatedBy" });
            DropIndex("dbo.Quotes", new[] { "CreatedBy" });
            DropIndex("dbo.QuoteItems", new[] { "CreatedBy" });
            DropIndex("dbo.Equipment", new[] { "CreatedBy" });
            DropIndex("dbo.Customers", new[] { "CreatedBy" });
            DropIndex("dbo.CustomerEquipments", new[] { "CreatedBy" });
            DropIndex("dbo.CertificateStandard", new[] { "CreatedBy" });
            DropIndex("dbo.Certificate", new[] { "CreatedBy" });
            AlterColumn("dbo.WorkOrders", "CreatedBy", c => c.String());
            AlterColumn("dbo.WorkOrderDetails", "CreatedBy", c => c.String());
            AlterColumn("dbo.Quotes", "CreatedBy", c => c.String());
            AlterColumn("dbo.QuoteItems", "CreatedBy", c => c.String());
            AlterColumn("dbo.Equipment", "CreatedBy", c => c.String());
            AlterColumn("dbo.Customers", "CreatedBy", c => c.String());
            AlterColumn("dbo.CustomerEquipments", "CreatedBy", c => c.String());
            AlterColumn("dbo.CertificateStandard", "CreatedBy", c => c.String());
            AlterColumn("dbo.Certificate", "CreatedBy", c => c.String());
        }
    }
}
